/**
 * 
 */
package masml2jade.agents;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

import masml2jade.AgentRole;
import masml2jade.Environment;
import masml2jade.Goal;
import masml2jade.Plan;
import masml2jade.behaviour.ReativoBehaviour;

import jade.core.Agent;

/**
 * @author Administrator
 *
 */
public abstract class UsefulAgent extends GoalAgent {
	
	private Hashtable<String, Plan> plans = new Hashtable<String, Plan>();
	
	protected UsefulAgent(Environment environment, AgentRole agentRole) {
		super(environment, agentRole);
		initialize();
	}
	
	protected void usefulFunction() {
	}
	
	// Plans
	public Plan getPlan(String key) {
		return plans.get(key);
	}
	public void addPlan(String key, Plan plan) {
		plans.put(key, plan);
	}
	public Plan removePlan(String key) {
		return plans.remove(key);
	}
	public void removeAllPlans() {
		plans.clear();
	}
	public Hashtable<String, Plan> getAllPlans() {
		return plans;
	}
	
	// Put agent initializations here
	  protected void setup() {
		  // Papel de agente
		  
	  }
	
	  // Put agent clean-up operations here
	  protected void takeDown() {
		  
	  }
	  
	  @Override
		protected abstract void initialize();
}
